home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Georgia Wildfire Prevention
/
Georgia Wildfire Prevention.iso
/
mac
/
media
/
dirs
/
BackUp
/
WildFire.dir
/
00007_Script_Question Behavior
< prev
next >
Wrap
Text File
|
2002-10-15
|
3KB
|
81 lines
--QUESTION BEHAVIOR--
global Neptune
property QuestionType, CorrectAnswer, QuestionA, QuestionB, QuestionC, QuestionD, QuestionSound, RightSound, WrongSound,AnsweredCorrectly, \
SpNum, MemNum, MyMem, CurrentQuestion
on new me
SpNum = me.spritenum
mm=sprite(spnum).member
MemNum =mm.number
MyMem = mm.name
AnsweredCorrectly = 0
CurrentQuestion = 0
end
on getpropertydescriptionlist me,
set pList = [\
#QuestionType: [#comment: "Will the question be True/False or Multiple Chioce? ", #format: #string, #range: ["True/False", "Multiple Choice"], #default: "True/False"],\
#CorrectAnswer: [#comment: "What is the correct answer for this question? ", #format: #string, #range: ["True", "False", "A", "B", "C", "D"], #default: "True"],\
#QuestionA: [#comment: "Question A:", #format:#string, #default: ""],\
#QuestionB: [#comment: "Question B:", #format:#string, #default: ""],\
#QuestionC: [#comment: "Question C:", #format:#string, #default: ""],\
#QuestionD: [#comment: "Question D:", #format:#string, #default: ""],\
#QuestionSound: [#comment: "What sound would you like to play for the question?", #format:#string, #default: ""],\
#RightSound: [#comment: "What sound would you like to play for a correct answer?", #format:#string, #default: ""],\
#WrongSound: [#comment: "What sound would you like to play for a wrong answer?", #format:#string,#default: ""]\
]
return pList
end
--Let's QuestionGod object know that it is available for asking.
on AvailableQuestions me
if AnsweredCorrectly = 0 then
AvailabilityResponse(Neptune, SpNum)
end if
end
--If the Next question's sprite number doesn't match, the spite goes dark. Else, it lights up.
on LightsOut me, NextQuestion
if SpNum <> NextQuestion then
sprite(SpNum).visible = 0
CurrentQuestion = 0
else
sprite(SpNum).visible = 1
CurrentQuestion = 1
sound(1).play(member(QuestionSound))
end if
end
--If the ButtonAnswer = my answer, I am no longer available to ask.
on ClickedButton me, ButtonAnswer
if CurrentQuestion = 1 then
sound(1).stop()
if ButtonAnswer = CorrectAnswer then
AnsweredCorrectly = 1
sound(1).play(member(RightSound))
else if ButtonAnswer <> CorrectAnswer then
sound(1).play(member(WrongSound))
end if
repeat while soundbusy(1)
nothing
end repeat
end if
end
on beginsprite me
sprite(spnum).visible=0
updatestage
end